Incs := ./mysql/
Srcs := $(wildcard *.c) $(wildcard ./mysql/*.c)
Outs := $(patsubst %.c, %.o, $(Srcs))
BIN:=server
CC := gcc
CFLAGS = -Wall -g -lcrypt -lmysqlclient

ALL: $(Outs) 
	$(CC) -o $(BIN) $^ $(CFLAGS) $(addprefix -I, $(Incs))

%.o: %.c
	$(CC) -c $< -o $@ $(CFLAGS) $(addprefix -I, $(Incs))
echo:
	@echo $(Outs)

.PHONY: clean rebuild ALL

clean:
	$(RM) $(Outs) $(BIN)
rebuild: clean ALL
